package com.lcxw.hxzb.friendcircle.project.system.controller;


import com.lcxw.hxzb.friendcircle.framework.web.controller.BaseController;
import com.lcxw.hxzb.friendcircle.framework.web.domain.AjaxResult;
import com.lcxw.hxzb.friendcircle.framework.web.page.TableDataInfo;
import com.lcxw.hxzb.friendcircle.project.system.domain.YwpdLabel;
import com.lcxw.hxzb.friendcircle.project.system.service.IYwpdLabelService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 游戏陪玩评价标签Controller
 * 
 * @author ruoyi
 * @date 2020-09-15
 */
@RestController
@Api(tags = "游戏陪玩评价标签Controller")
@RequestMapping("/client/label")
public class YwpdLabelController extends BaseController
{
    @Autowired
    private IYwpdLabelService ywpdLabelService;

    /**
     * 查询游戏陪玩评价标签列表
     */
    @GetMapping("/list")
    public AjaxResult list(YwpdLabel ywpdLabel)
    {
        List<YwpdLabel> list = ywpdLabelService.selectYwpdLabelList(ywpdLabel);
        return AjaxResult.success(list);
    }

    /**
     * 获取游戏陪玩评价标签详细信息
     */
    @GetMapping(value = "/{labelId}")
    public AjaxResult getInfo(@PathVariable("labelId") Long labelId)
    {
        return AjaxResult.success(ywpdLabelService.selectYwpdLabelById(labelId));
    }

    /**
     * 新增游戏陪玩评价标签
     */
    @PostMapping
    public AjaxResult add(@RequestBody YwpdLabel ywpdLabel)
    {
        return toAjax(ywpdLabelService.insertYwpdLabel(ywpdLabel));
    }

    /**
     * 修改游戏陪玩评价标签
     */
    @PutMapping
    public AjaxResult edit(@RequestBody YwpdLabel ywpdLabel)
    {
        return toAjax(ywpdLabelService.updateYwpdLabel(ywpdLabel));
    }

    /**
     * 删除游戏陪玩评价标签
     */
	@DeleteMapping("/{labelIds}")
    public AjaxResult remove(@PathVariable Long[] labelIds)
    {
        return toAjax(ywpdLabelService.deleteYwpdLabelByIds(labelIds));
    }
}
